const express = require("express");
const bodyParser = require("body-parser");
const app = express();

app.use(express.static("./www"));
app.use(bodyParser());

app.get("/login",(req, res, next)=>{
    const q = req.query;
    console.log("get方式请求的数据：", q);
    res.send({
        code:1,
        title:"登录成功",
        username: q.username,
        password: q.password
    });
})

app.post("/register",(req, res)=>{
    const b = req.body;
    console.log("post方式请求的数据：", b);
    res.send({
        code:1,
        title:"注册成功",
        username:b.username,
        password:b.password
    });
})

app.listen(3001);

